from libs.db import DB


def query_warehouse_goods_class_dict_by_ids(cursor, ids):
    db = DB('table_warehouse_goodclass', conn=cursor)
    rows = db.find(['id', 'class_name'], 'id in ({})'.format(ids))
    md = {}
    for row in rows:
        class_id = row.get('id')
        class_name = row.get('class_name')
        md.update({class_id: class_name})
    return md
